package se.olli.jonsered;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class FamiljenActivity extends Activity {
	private ListView list;
	private MainMenuAdapter adapter;
	private Intent characterActivity;
	private final String[] menuVals = new String[] { "Pappa Oscar", "Mamma Charlotta", "David",
			"Carolina", "Sofia", "August", "Carl"};
	private final Integer[] menuIcons = {
			R.drawable.menu_dot, R.drawable.menu_dot,
			R.drawable.menu_dot, R.drawable.menu_dot,
			R.drawable.menu_dot, R.drawable.menu_dot,
			R.drawable.menu_dot
	};

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		characterActivity = new Intent(this, CharacterActivity.class);

		list = (ListView) findViewById(R.id.main_menu);
		adapter = new MainMenuAdapter(this, menuVals, menuIcons);
		list.setAdapter(adapter);
		list.setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				characterActivity.putExtra(JonseredActivity.CHARACTER, position);
				startActivity(characterActivity);
			}
		});
	}
}
